package com.shenjun.controller;


import cn.hutool.core.date.DateUtil;
import com.shenjun.config.PatternProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;

@RestController
public class TestController {

    @Autowired
    private PatternProperties patternProperties;

    @GetMapping("/test001")
    public String test001() {
        String format = DateUtil.format(new Date(), patternProperties.getDateformat());
        return format;
    }

    @GetMapping("/test002")
    public String test002() {
        String format = DateUtil.format(new Date(), patternProperties.getAllDateformat());
        return format;
    }
}
